import { Injectable } from '@angular/core';
import {HttpClient,HttpHeaders,HttpParams} from '@angular/common/http';
import Qs from 'qs';
import { environment } from '../../environments/environment';
console.log(environment.baseURL);

@Injectable({
  providedIn: 'root'
})
export class RxjsService {

  constructor(public http:HttpClient) { }

  postFun(url,data){
      return this.http.post(environment.baseURL+url,data,{
        headers:new HttpHeaders({
          'Content-Type':'application/json'
        })
      })
  }

  getFun(url,data){
      var params = Qs.stringify(data);
      return this.http.get(environment.baseURL+url+'?'+params)
  }
}
